Skip to content

[WIP] Attempt to run on Linux#87

Open
Joannis wants to merge 6 commits intoml-explore:mainfrom
Joannis:jo/linux-support
Open

[WIP] Attempt to run on Linux#87
Joannis wants to merge 6 commits intoml-explore:mainfrom
Joannis:jo/linux-support

Conversation

@Joannis
Copy link
Copy Markdown

@Joannis Joannis commented Jan 29, 2026

Proposed changes

Please include a description of the problem or feature this PR is addressing. If there is a corresponding issue, include the issue #.

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING document
  • I have run pre-commit run --all-files to format my code / installed pre-commit prior to committing changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the necessary documentation (if needed)

@Joannis
Copy link
Copy Markdown
Author

Joannis commented Jan 29, 2026

Sorry for the maintainers, I pushed this WIP code here for public tracking of a bug I'm sorting first. I'm assuming you're on the same team

@davidkoski
Copy link
Copy Markdown
Collaborator

Sorry for the maintainers, I pushed this WIP code here for public tracking of a bug I'm sorting first. I'm assuming you're on the same team

Yep, same people :-)

@Joannis Joannis force-pushed the jo/linux-support branch 2 times, most recently from 7c60522 to e0769a0 Compare February 20, 2026 10:12
@Joannis Joannis force-pushed the jo/linux-support branch 2 times, most recently from dbd6a34 to 757239b Compare February 20, 2026 13:44
@Joannis Joannis changed the title [WIP] Attempt to run on Linux (mostly works) [WIP] Attempt to run on Linux Feb 20, 2026
@Joannis Joannis marked this pull request as ready for review February 20, 2026 13:48
@Joannis
Copy link
Copy Markdown
Author

Joannis commented Feb 20, 2026

@davidkoski this is ready for review. I've added CI (wasn't able to run it on my fork for some reason).

Highly recommend disabling whitespace when viewing this PR. I've added a fair amount of #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) || os(visionOS) checks around where I couldn't run it on Linux (yet). Formatting made sure that this blows up the diff.

With this change, I was able to run MLXLM, (not VLM) on Linux. I did have to use a custom build with GPU acceleration to run this, as I couldn't use it on CPU mode due to this: ml-explore/mlx#3080

The float16 issue is also present on my macOS device if I run it in docker. So unfortunately I can't make an end-to-end Docker example until we solve CUDA. Working on that though

@davidkoski
Copy link
Copy Markdown
Collaborator

Yeah, the VLM code probably needs some thinking to separate out the image processing and image representation. The models should all be dealing with MLXArray, hopefully we can just replace MediaProcessing.


import Foundation
import MLX
import MLXFast
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't need this -- MLXFast is an empty package with some stubs to forward back to MLX. MLX has an enum MLXFast so without import MLXFast the same code should still compile.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good one yeah. It's an artifact since this code has been on my machine for a while. Will rid of it

let x1 = x[.ellipsis, 0 ..< index]
let x2 = x[.ellipsis, index...]
return concatenated([-x2, x1], axis: -1)
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) || os(visionOS)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work on Linux yet

@Joannis Joannis requested a review from davidkoski February 20, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants